package com.ky.admin.automobile;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.BaseAdapter;
import android.widget.ListView;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.linerlout);
        System.out.println("aaa");
        System.out.println("bbbbb");


        System.out.println("cccc"); System.out.println("ddd");
        System.out.println("cccc"); System.out.println("ddd");
        System.out.println("第一次修改");
       ListView listView = (ListView) findViewById(R.id.lv);
        listView.setAdapter(new NewAdapter());
        listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
                startActivity(new Intent(MainActivity.this,HomeActivity.class));
            }
        });
    }

    class  NewAdapter extends BaseAdapter{

        @Override
        public int getCount() {
            return 20;
        }

        @Override
        public Object getItem(int i) {
            return null;
        }

        @Override
        public long getItemId(int i) {
            return 0;
        }

        @Override
        public View getView(int i, View view, ViewGroup viewGroup) {
            View view1 = View.inflate(MainActivity.this,R.layout.item,null);
            return view1;
        }
    }
}
